<template>
	<view>
		<view class="container" style="margin-top: 20upx;">
			<!-- 带上拉加载的数据列表 -->
			<view class="big-loading-text loading-text" style="height: 80upx;line-height: 80upx;">
				<text>时间</text>
				<text>数量</text>
				<text>来源</text>
			</view>
			<!-- 数据列表 -->
			<scroll-view scroll-y="true" style="height: 300upx;">
				<view class="loading-text" @click="toarticlexq(value.projectid)" v-for="(value,key) in list" :key="key" style="height: 50upx;line-height: 50upx;">
					<text style="display: block;width: 300upx;">{{value.time}}</text>
					<text>{{value.num}}</text>
					<text>{{value.remark}}</text>
				</view>
				<view v-if="list.length == 0" style="height: 100upx;color: #B81738;padding: 30upx;">
					<view style="font-size: 32upx;font-weight: 550;text-align: center;">
						暂无记录
					</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	export default {
	  data() {
	   return {
	    openid: '',
			list:[],
			message:'',
			type:'',
	   }
	  },
	 onLoad: function(e) {
		 this.type = e.type
		 // console.log(this.type)
	 	uni.showLoading()
	 	uni.getStorage({
	 		key: 'openid',
	 		success: (res) => {
	 			this.openid = res.data
	 			this.getdata()
	 			//页面一加载时请求一次数据`
	 			uni.hideLoading()
	 		},
	 		fail: () => {
	 			uni.navigateTo({
	 				url: '../login/login'
	 			});
	 		}
	 	});
	 },
	  methods: {
			getdata(){
				uni.request({
					url: this.$BASE_URL+'/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=tzz.dj_three&app=1',
					method: 'POST',
					data: {
						'openid':this.openid,
						'type' : this.type,
					},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success:(res) => {
						console.log(res)
						this.list = res.data.list 
						// this.message = res.data.message
					},
					fail: () => {},
					complete: () => {}
				});
			},
	  }
	 }
</script>
<style>
.container {
	/* background-color: #FEA23D; */
}
.loading-text {
	margin: ;
	background-color: fff;
	display: flex;
}

.loading-text text:nth-child(1) {
	padding-left: 15upx;
	border-bottom: 2upx solid rgb(243,243,243);
	background-color: #fff;
	flex: 1.5;
	text-align: center;
	font-size: 26upx;
}
.loading-text text:nth-child(2) {
	border-bottom: 2upx solid rgb(243,243,243);
	background-color: #fff;
	flex: 1;
	text-align: center;
	font-size: 26upx;
}
.loading-text text:nth-child(3) {
	border-bottom: 2upx solid rgb(243,243,243);
	background-color: #fff;
	flex: 1;
	text-align: center;
	font-size: 26upx;
}
.loading-text text:nth-child(4) {
	border-bottom: 2upx solid rgb(243,243,243);
	background-color: #fff;
	flex: 5;
	text-align: center;
	font-size: 26upx;
}
.all_add {
	height: 80upx;
	text-align: center;
	line-height: 80upx;
	background-color: rgb(254,162,61);
	color: #fff;
}
.big-loading-text {
	font-weight: 550;
	border-bottom: 2upx solid rgb(243,243,243);
}
uni-page-body{height:100%;}
</style>
